# -*- coding: utf-8 -*-

from apyori import apriori

transactions = [['面包', '牛奶','香蕉'],
    ['面包', '牛奶', '鸡蛋'],
    ['牛奶', '鸡蛋','香蕉'],
    ['面包', '牛奶', '鸡蛋'],
    ['面包', '牛奶', '鸡蛋', '香蕉'],
    ['面包', '牛奶', '香蕉'],
    ['面包', '牛奶', '鸡蛋'],
    ['牛奶', '鸡蛋','香蕉'],
    ['面包', '牛奶', '鸡蛋']
]
'''
results = list(apriori(transactions, min_support=0.4))
#print(results)
for item in results:
    #pair = item[0] 
    #items = [x for x in pair]
    #print("频繁项集: " + str(items))
    #print("支持度: " + str(item[1]))
    #print("置信度: " + str(item[2][0][2]))
    #print("\n")
    print(item[2][0])
'''
